package com.agenda.video;

import javax.media.Manager;
import javax.media.MediaLocator;
import javax.media.Player;
import javax.swing.JFrame;

public class ReceptorRTPVideo extends JFrame {
	private String ip;
	private String porta;

	public ReceptorRTPVideo(String ip, String porta) {
		this.ip = ip;
		this.porta = porta;
	}

	public void start() {
		try {
			//String url= "rtp://10.65.97.94:5530/video";
			//192.168.1.107    5530
			String url = "rtp://" + ip + ":" + porta + "/video";
			MediaLocator dadosRecebidos = new MediaLocator(url);

			Player player = Manager.createRealizedPlayer(dadosRecebidos);

			player.start();

			setSize(300, 300);
			getContentPane().add(player.getVisualComponent());
			setVisible(true);
		} catch (Exception exc) {
			exc.printStackTrace();
		}
	}

}
